/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-03-01
 * Time: 23:48
 */
public class SumOfCompose {
    //返回的数字之和
    public static int sumOfCompose(int num){
        if (num == 0){
            return 0;
        }
        return sumOfCompose(num / 10) + num % 10;
    }

    public static void main(String[] args) {
        System.out.println(sumOfCompose(1234));
    }
}
